<template>
  <div>
    <van-list
      v-if="list"
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
      <van-cell v-for="item in list" :key="item.id">
        <comp-goodsitem :item="item"></comp-goodsitem>
      </van-cell>
    </van-list>
  </div>
</template>
<script>
import { get } from "../../../utils/util";
import compGoodsitem from "@/components/compGoodsitem.vue";
export default {
  props: {
    v1: {
      type: String,
    },
    list: {
      type: Array,
    },
  },
  components: { compGoodsitem },
  data() {
    return {
      loading: false,
      finished: false,
    };
  },
  methods: {
    onLoad() {
      setTimeout(() => {
        //    加载状态结束
        this.loading = false;
        //   全部数据完成
        if (this.list.length >= this.list.length) {
          this.finished = true;
        }
      }, 2000);
    },
  
  },
};
</script>